package com.example.design.bilibili.singleton;

/**
 * 静态内部类完成，推荐使用
 */
public class SingletonTest7 {

    public static void main(String[] args) {

    }
}

class Singleton7{

    private Singleton7(){

    }

    //写一个静态内部类，该类中有一个静态属性Singleton7
    private static class SingletonInstance{
        private static final Singleton7 instance = new Singleton7();
    }

    public static Singleton7 getInstance(){

        return SingletonInstance.instance;
    }
}
